version: "3.10"

x-build-args:
  &build-args
  PIP_INDEX_URL: $PIP_INDEX_URL

services:
  dependencies:
    image: "anonymizer:dependencies-1"
    build:
      context: .
      cache_from:
        - "${PYTHON_IMAGE}"
      target: dependencies
      args:
        <<: *build-args

  app:
    image: "anonymizer:1"
    build:
      context: .
      cache_from:
        - "anonymizer:dependencies-1"
      target: production
      args:
        <<: *build-args
    volumes:
      - ./src:/src/src
    ports:
      - "8000:8000"
    env_file:
      - .env
